﻿using Hotel.BLL;
using Hotel.DAL;
using Hotel.Model;
using Hotel.Model.admin;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Hotel.Server.Controllers
{
    [Route("api/[controller]/[action]" )]
    [ApiController]
    public class AdminsController : ControllerBase
    {
        public AdminsController(adminBLL adminBLL)
        {
            AdminBLL = adminBLL;
        }

        public adminBLL AdminBLL { get; }


        /// <summary>
        /// /管理员登录
        /// </summary>
        /// <param name="username">用户名</param>
        /// <param name="userpwd">密码</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult Login(string username, string? userpwd)
        {
            try
            {
               var res=AdminBLL.Login(username,userpwd);
                return Ok(res);
            }
            catch (Exception ex)
            {

                throw ex;
            }


        }




    




















    }
}
